package org.smarthings.things.automation.engine;

import org.smarthings.things.management.Thing;
import org.smarthings.things.management.ThingActionCollection;
import org.smarthings.things.management.ThingPropertyCollection;

public class ThingFacade {

	private Thing thing;

	public final String UID;
	public final ThingPropertyCollectionFacade properties;
	public final ThingActionCollectionFacade actions;

	public ThingFacade(Thing thing) {
		this.thing = thing;
		this.UID = thing.getUUID();
		ThingPropertyCollection properties = thing.getProperties();
		if (properties != null) {
			this.properties = new ThingPropertyCollectionFacade(properties);
		} else {
			this.properties = null;
		}
		ThingActionCollection actions = thing.getActions();
		if (actions != null) {
			this.actions = new ThingActionCollectionFacade(actions);
		} else {
			this.actions = null;
		}
	}

	public String[] tags() {
		return thing.getTags();
	}

	public void tags(String[] tags) {
		thing.setTags(tags);
	}

	public String name() {
		return thing.getName();
	}

	public void name(String name) {
		thing.setName(name);
	}

}
